/*
 * Copyright (C) 2011, EADS France
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */
package xowl.interpreter.frontends;

import java.io.Writer;

/**
 *
 * @author Laurent WOUTERS
 */
public abstract class AbstractAxiomWriter {
    public void writeAxiom(Writer writer, xowl.lang.owl2.Axiom axiom) throws java.io.IOException {
        java.lang.Class c = axiom.getClass();
        if (c == xowl.lang.owl2.Declaration.class) writeDeclaration(writer, (xowl.lang.owl2.Declaration)axiom);
        else if (c == xowl.lang.owl2.DatatypeDefinition.class) writeDatatypeDefinition(writer, (xowl.lang.owl2.DatatypeDefinition)axiom);
        else if (c == xowl.lang.owl2.SubClassOf.class) writeSubClassOf(writer, (xowl.lang.owl2.SubClassOf)axiom);
        else if (c == xowl.lang.owl2.EquivalentClasses.class) writeEquivalentClasses(writer, (xowl.lang.owl2.EquivalentClasses)axiom);
        else if (c == xowl.lang.owl2.DisjointClasses.class) writeDisjointClasses(writer, (xowl.lang.owl2.DisjointClasses)axiom);
        else if (c == xowl.lang.owl2.DisjointUnion.class) writeDisjointUnion(writer, (xowl.lang.owl2.DisjointUnion)axiom);
        else if (c == xowl.lang.owl2.SubObjectPropertyOf.class) writeSubObjectPropertyOf(writer, (xowl.lang.owl2.SubObjectPropertyOf)axiom);
        else if (c == xowl.lang.owl2.EquivalentObjectProperties.class) writeEquivalentObjectProperties(writer, (xowl.lang.owl2.EquivalentObjectProperties)axiom);
        else if (c == xowl.lang.owl2.DisjointObjectProperties.class) writeDisjointObjectProperties(writer, (xowl.lang.owl2.DisjointObjectProperties)axiom);
        else if (c == xowl.lang.owl2.InverseObjectProperties.class) writeInverseObjectProperties(writer, (xowl.lang.owl2.InverseObjectProperties)axiom);
        else if (c == xowl.lang.owl2.ObjectPropertyDomain.class) writeObjectPropertyDomain(writer, (xowl.lang.owl2.ObjectPropertyDomain)axiom);
        else if (c == xowl.lang.owl2.ObjectPropertyRange.class) writeObjectPropertyRange(writer, (xowl.lang.owl2.ObjectPropertyRange)axiom);
        else if (c == xowl.lang.owl2.FunctionalObjectProperty.class) writeFunctionalObjectProperty(writer, (xowl.lang.owl2.FunctionalObjectProperty)axiom);
        else if (c == xowl.lang.owl2.InverseFunctionalObjectProperty.class) writeInverseFunctionalObjectProperty(writer, (xowl.lang.owl2.InverseFunctionalObjectProperty)axiom);
        else if (c == xowl.lang.owl2.ReflexiveObjectProperty.class) writeReflexiveObjectProperty(writer, (xowl.lang.owl2.ReflexiveObjectProperty)axiom);
        else if (c == xowl.lang.owl2.IrreflexiveObjectProperty.class) writeIrreflexiveObjectProperty(writer, (xowl.lang.owl2.IrreflexiveObjectProperty)axiom);
        else if (c == xowl.lang.owl2.SymmetricObjectProperty.class) writeSymmetricObjectProperty(writer, (xowl.lang.owl2.SymmetricObjectProperty)axiom);
        else if (c == xowl.lang.owl2.AsymmetricObjectProperty.class) writeAsymmetricObjectProperty(writer, (xowl.lang.owl2.AsymmetricObjectProperty)axiom);
        else if (c == xowl.lang.owl2.TransitiveObjectProperty.class) writeTransitiveObjectProperty(writer, (xowl.lang.owl2.TransitiveObjectProperty)axiom);
        else if (c == xowl.lang.owl2.SubDataPropertyOf.class) writeSubDataPropertyOf(writer, (xowl.lang.owl2.SubDataPropertyOf)axiom);
        else if (c == xowl.lang.owl2.EquivalentDataProperties.class) writeEquivalentDataProperties(writer, (xowl.lang.owl2.EquivalentDataProperties)axiom);
        else if (c == xowl.lang.owl2.DisjointDataProperties.class) writeDisjointDataProperties(writer, (xowl.lang.owl2.DisjointDataProperties)axiom);
        else if (c == xowl.lang.owl2.DataPropertyDomain.class) writeDataPropertyDomain(writer, (xowl.lang.owl2.DataPropertyDomain)axiom);
        else if (c == xowl.lang.owl2.DataPropertyRange.class) writeDataPropertyRange(writer, (xowl.lang.owl2.DataPropertyRange)axiom);
        else if (c == xowl.lang.owl2.FunctionalDataProperty.class) writeFunctionalDataProperty(writer, (xowl.lang.owl2.FunctionalDataProperty)axiom);
        else if (c == xowl.lang.owl2.SameIndividual.class) writeSameIndividual(writer, (xowl.lang.owl2.SameIndividual)axiom);
        else if (c == xowl.lang.owl2.DifferentIndividuals.class) writeDifferentIndividuals(writer, (xowl.lang.owl2.DifferentIndividuals)axiom);
        else if (c == xowl.lang.owl2.ClassAssertion.class) writeClassAssertion(writer, (xowl.lang.owl2.ClassAssertion)axiom);
        else if (c == xowl.lang.owl2.ObjectPropertyAssertion.class) writeObjectPropertyAssertion(writer, (xowl.lang.owl2.ObjectPropertyAssertion)axiom);
        else if (c == xowl.lang.owl2.NegativeObjectPropertyAssertion.class) writeNegativeObjectPropertyAssertion(writer, (xowl.lang.owl2.NegativeObjectPropertyAssertion)axiom);
        else if (c == xowl.lang.owl2.DataPropertyAssertion.class) writeDataPropertyAssertion(writer, (xowl.lang.owl2.DataPropertyAssertion)axiom);
        else if (c == xowl.lang.owl2.NegativeDataPropertyAssertion.class) writeNegativeDataPropertyAssertion(writer, (xowl.lang.owl2.NegativeDataPropertyAssertion)axiom);
        else if (c == xowl.lang.owl2.HasKey.class) writeHasKey(writer, (xowl.lang.owl2.HasKey)axiom);
        else if (c == xowl.lang.owl2.SubAnnotationPropertyOf.class) writeSubAnnotationPropertyOf(writer, (xowl.lang.owl2.SubAnnotationPropertyOf)axiom);
        else if (c == xowl.lang.owl2.AnnotationPropertyDomain.class) writeAnnotationPropertyDomain(writer, (xowl.lang.owl2.AnnotationPropertyDomain)axiom);
        else if (c == xowl.lang.owl2.AnnotationPropertyRange.class) writeAnnotationPropertyRange(writer, (xowl.lang.owl2.AnnotationPropertyRange)axiom);
        else if (c == xowl.lang.owl2.AnnotationAssertion.class) writeAnnotationAssertion(writer, (xowl.lang.owl2.AnnotationAssertion)axiom);
        else if (c == xowl.lang.actions.FunctionDefinition.class) writeFunctionDefinition(writer, (xowl.lang.actions.FunctionDefinition)axiom);
    }
    
    protected abstract void writeDeclaration(Writer writer, xowl.lang.owl2.Declaration axiom) throws java.io.IOException;
    protected abstract void writeDatatypeDefinition(Writer writer, xowl.lang.owl2.DatatypeDefinition axiom) throws java.io.IOException;
    protected abstract void writeSubClassOf(Writer writer, xowl.lang.owl2.SubClassOf axiom) throws java.io.IOException;
    protected abstract void writeEquivalentClasses(Writer writer, xowl.lang.owl2.EquivalentClasses axiom) throws java.io.IOException;
    protected abstract void writeDisjointClasses(Writer writer, xowl.lang.owl2.DisjointClasses axiom) throws java.io.IOException;
    protected abstract void writeDisjointUnion(Writer writer, xowl.lang.owl2.DisjointUnion axiom) throws java.io.IOException;
    protected abstract void writeSubObjectPropertyOf(Writer writer, xowl.lang.owl2.SubObjectPropertyOf axiom) throws java.io.IOException;
    protected abstract void writeEquivalentObjectProperties(Writer writer, xowl.lang.owl2.EquivalentObjectProperties axiom) throws java.io.IOException;
    protected abstract void writeDisjointObjectProperties(Writer writer, xowl.lang.owl2.DisjointObjectProperties axiom) throws java.io.IOException;
    protected abstract void writeInverseObjectProperties(Writer writer, xowl.lang.owl2.InverseObjectProperties axiom) throws java.io.IOException;
    protected abstract void writeObjectPropertyDomain(Writer writer, xowl.lang.owl2.ObjectPropertyDomain axiom) throws java.io.IOException;
    protected abstract void writeObjectPropertyRange(Writer writer, xowl.lang.owl2.ObjectPropertyRange axiom) throws java.io.IOException;
    protected abstract void writeFunctionalObjectProperty(Writer writer, xowl.lang.owl2.FunctionalObjectProperty axiom) throws java.io.IOException;
    protected abstract void writeInverseFunctionalObjectProperty(Writer writer, xowl.lang.owl2.InverseFunctionalObjectProperty axiom) throws java.io.IOException;
    protected abstract void writeReflexiveObjectProperty(Writer writer, xowl.lang.owl2.ReflexiveObjectProperty axiom) throws java.io.IOException;
    protected abstract void writeIrreflexiveObjectProperty(Writer writer, xowl.lang.owl2.IrreflexiveObjectProperty axiom) throws java.io.IOException;
    protected abstract void writeSymmetricObjectProperty(Writer writer, xowl.lang.owl2.SymmetricObjectProperty axiom) throws java.io.IOException;
    protected abstract void writeAsymmetricObjectProperty(Writer writer, xowl.lang.owl2.AsymmetricObjectProperty axiom) throws java.io.IOException;
    protected abstract void writeTransitiveObjectProperty(Writer writer, xowl.lang.owl2.TransitiveObjectProperty axiom) throws java.io.IOException;
    protected abstract void writeSubDataPropertyOf(Writer writer, xowl.lang.owl2.SubDataPropertyOf axiom) throws java.io.IOException;
    protected abstract void writeEquivalentDataProperties(Writer writer, xowl.lang.owl2.EquivalentDataProperties axiom) throws java.io.IOException;
    protected abstract void writeDisjointDataProperties(Writer writer, xowl.lang.owl2.DisjointDataProperties axiom) throws java.io.IOException;
    protected abstract void writeDataPropertyDomain(Writer writer, xowl.lang.owl2.DataPropertyDomain axiom) throws java.io.IOException;
    protected abstract void writeDataPropertyRange(Writer writer, xowl.lang.owl2.DataPropertyRange axiom) throws java.io.IOException;
    protected abstract void writeFunctionalDataProperty(Writer writer, xowl.lang.owl2.FunctionalDataProperty axiom) throws java.io.IOException;
    protected abstract void writeSameIndividual(Writer writer, xowl.lang.owl2.SameIndividual axiom) throws java.io.IOException;
    protected abstract void writeDifferentIndividuals(Writer writer, xowl.lang.owl2.DifferentIndividuals axiom) throws java.io.IOException;
    protected abstract void writeClassAssertion(Writer writer, xowl.lang.owl2.ClassAssertion axiom) throws java.io.IOException;
    protected abstract void writeObjectPropertyAssertion(Writer writer, xowl.lang.owl2.ObjectPropertyAssertion axiom) throws java.io.IOException;
    protected abstract void writeNegativeObjectPropertyAssertion(Writer writer, xowl.lang.owl2.NegativeObjectPropertyAssertion axiom) throws java.io.IOException;
    protected abstract void writeDataPropertyAssertion(Writer writer, xowl.lang.owl2.DataPropertyAssertion axiom) throws java.io.IOException;
    protected abstract void writeNegativeDataPropertyAssertion(Writer writer, xowl.lang.owl2.NegativeDataPropertyAssertion axiom) throws java.io.IOException;
    protected abstract void writeHasKey(Writer writer, xowl.lang.owl2.HasKey axiom) throws java.io.IOException;
    protected abstract void writeSubAnnotationPropertyOf(Writer writer, xowl.lang.owl2.SubAnnotationPropertyOf axiom) throws java.io.IOException;
    protected abstract void writeAnnotationPropertyDomain(Writer writer, xowl.lang.owl2.AnnotationPropertyDomain axiom) throws java.io.IOException;
    protected abstract void writeAnnotationPropertyRange(Writer writer, xowl.lang.owl2.AnnotationPropertyRange axiom) throws java.io.IOException;
    protected abstract void writeAnnotationAssertion(Writer writer, xowl.lang.owl2.AnnotationAssertion axiom) throws java.io.IOException;
    protected abstract void writeFunctionDefinition(Writer writer, xowl.lang.actions.FunctionDefinition change) throws java.io.IOException;
}
